package com.mes.schedule.algorithm;

import java.io.StringReader;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Collection;
import java.util.Collections;
import java.util.Comparator;
import java.util.Date;
import java.util.Iterator;
import java.util.List;
import java.util.Map.Entry;

import org.apache.commons.lang.StringUtils;
import org.jdom2.Document;
import org.jdom2.Element;
import org.jdom2.input.SAXBuilder;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;
import com.mes.common.util.Page;
import com.mes.schedule.algorithm.iface.IScheduleStateFind;
import com.mes.schedule.dao.ScheduleEventDao;
import com.mes.schedule.domain.SCoTask;
import com.mes.schedule.domain.SDevice;
import com.mes.schedule.domain.SOperationTask;
import com.mes.schedule.domain.SPartTask;
import com.mes.schedule.domain.ScheduleEvent;
import com.mes.schedule.domain.ScheduleScheme;
import com.mes.schedule.manager.ScheduleAnalysis;

@Component("scheduleStateFind")
public class ScheduleStateFind implements IScheduleStateFind{
	@javax.annotation.Resource
	protected ScheduleAnalysis scheduleAnalysis;
	@javax.annotation.Resource
	private ScheduleEventDao scheduleEventDao;
	static SimpleDateFormat formatDate = new SimpleDateFormat(
			"yyyy-MM-dd HH:mm:ss");

	public List<SPartTask> partTaskSortByDelay(ScheduleScheme scheme) {
		Collection<SPartTask> partTaskList = scheme.getSchedulePartTasks();
		List<SPartTask> list = new ArrayList<SPartTask>();
		for (SPartTask partTask : partTaskList) {
			if (partTask.getDelayDays() != null && partTask.getDelayDays() > 0) {
				list.add(partTask);
			}
		}
		Collections.sort(list, new Comparator<Object>() {
			public int compare(Object o1, Object o2) {
				SPartTask partTask1 = (SPartTask) o1;
				SPartTask partTask2 = (SPartTask) o2;
				int i = 0;
				if (partTask1.getDelayDays() < partTask2.getDelayDays()) {
					i = 1;
				}
				return i;
			}
		});
		return list;
	}

	public List<SPartTask> partTaskSortByWaitTime(ScheduleScheme scheme) {
		Collection<SPartTask> partTaskList = scheme.getSchedulePartTasks();
		List<SPartTask> list = new ArrayList<SPartTask>();
		for (SPartTask partTask : partTaskList) {
			if (partTask.getDelayDays() != null && partTask.getDelayDays() > 0) {
				list.add(partTask);
			}
		}
		Collections.sort(list, new Comparator<Object>() {
			public int compare(Object o1, Object o2) {
				SPartTask partTask1 = (SPartTask) o1;
				SPartTask partTask2 = (SPartTask) o2;
				int i = 0;
				if (partTask1.getWaitTime() < partTask2.getWaitTime()) {
					i = 1;
				}
				return i;
			}
		});
		return list;
	}

	public List<SOperationTask> sOperationTaskSortByWaitTime(
			ScheduleScheme scheme) {
		Collection<SOperationTask> operationTaskList = scheme
				.getScheduleOperationTasks();
		List<SOperationTask> list = new ArrayList<SOperationTask>();
		for (SOperationTask partTask : operationTaskList) {
			if (partTask.getWaitTime() > 0) {
				list.add(partTask);
			}
		}
		Collections.sort(list, new Comparator<Object>() {
			public int compare(Object o1, Object o2) {
				SOperationTask sOperationTask1 = (SOperationTask) o1;
				SOperationTask sOperationTask2 = (SOperationTask) o2;
				int i = 0;
				if (sOperationTask1.getWaitTime() < sOperationTask2
						.getWaitTime()) {
					i = 1;
				}
				return i;
			}
		});
		return list;
	}

	public List<SDevice> deviceSortByIdleTime(List<SDevice> list) {

		Collections.sort(list, new Comparator<Object>() {
			public int compare(Object o1, Object o2) {
				SDevice sDevice1 = (SDevice) o1;
				SDevice sDevice2 = (SDevice) o2;
				int i = 0;
				if (sDevice1.getTotalIdleTime() < sDevice2.getTotalIdleTime()) {
					i = 1;
				}
				return i;
			}
		});
		return list;
	}

	public List<SDevice> getDeviceSortByCriticalLevel(ScheduleScheme scheme) {

		List<SDevice> list = new ArrayList<SDevice>();
		if (scheme == null)
			return null;
		if (scheme.getDeviceMap() == null || scheme.getDeviceMap().isEmpty())
			return null;

		for (SDevice device : scheme.getDeviceMap().values()) {
			if (!device.getVirtual()) {
				list.add(device);
			}
		}

		Collections.sort(list, new Comparator<Object>() {
			public int compare(Object o1, Object o2) {
				SDevice sDevice1 = (SDevice) o1;
				SDevice sDevice2 = (SDevice) o2;
				int i = 0;
				if (sDevice1.getCriticalLevel() > sDevice2.getCriticalLevel()) {
					i = 1;
				} else if (sDevice1.getCriticalLevel() < sDevice2
						.getCriticalLevel()) {
					i = -1;
				} else {
					i = sDevice1.getDeviceUid().compareTo(
							sDevice2.getDeviceUid());
				}
				return i;
			}
		});
		return list;
	}

	/**
	 * 给定一个调度方案，找出其拖期时间最长的零件任务 .........
	 */
	public SPartTask findMostTardiness(ScheduleScheme scheme) {

		List<SPartTask> partTasks = partTaskSortByDelay(scheme);
		return partTasks.get(0);
	}

	/**
	 * 给定一个调度方案，找出其等待时间最长的零件任务 .........
	 */
	public SPartTask findMostWaitTime(ScheduleScheme scheme) {

		List<SPartTask> partTasks = partTaskSortByWaitTime(scheme);
		return partTasks.get(0);
	}

	/**
	 * 给定一个调度方案，给出其零件任务按等待时间排列的任务列表 .........
	 */
	public List<SPartTask> getPartTasksSortByWaitTime(ScheduleScheme scheme) {

		List<SPartTask> partTasks = partTaskSortByWaitTime(scheme);
		return partTasks;
	}

	/**
	 * 给定一个调度方案，给出其零件任务按拖期时间排列的任务列表 .........
	 */
	public List<SPartTask> getPartTasksSortByTardiness(ScheduleScheme scheme) {

		List<SPartTask> partTasks = partTaskSortByDelay(scheme);
		return partTasks;
	}

	/**
	 * 给定一个调度方案，给出其工序任务按拖期时间排列的任务列表 .........
	 */
	public List<SOperationTask> getOperationTasksSortByTardiness(
			ScheduleScheme scheme) {

		List<SOperationTask> sOperationTaskList = sOperationTaskSortByWaitTime(scheme);
		return sOperationTaskList;
	}

	/**
	 * 给定一个调度方案，给出等待时间最长的工序任务 .........
	 */
	public SOperationTask findMostWaitTimeSOperationTask(ScheduleScheme scheme) {

		List<SOperationTask> sOperationTaskList = sOperationTaskSortByWaitTime(scheme);
		return sOperationTaskList.get(0);
	}

	/**
	 * 给定一个调度方案，找出其具有等待时间的最长拖期的零件任务 .........
	 */
	public SPartTask findMostTardinessWithWaitTime(ScheduleScheme scheme) {

		List<SPartTask> partTasks = partTaskSortByDelay(scheme);
		List<SPartTask> list = new ArrayList<SPartTask>();
		for (SPartTask partTask : partTasks) {
			if (partTask.getWaitTime() > 0) {
				list.add(partTask);
			}
		}
		return list.get(0);
	}

	/**
	 * 给定一个调度方案，找出其最空闲的设备 .........
	 */
	public SDevice findMostIdleDevice(ScheduleScheme scheme) {

		List<SDevice> list = new ArrayList<SDevice>();
		Iterator iter = scheme.getDeviceMap().entrySet().iterator(); // 获得map的Iterator
		while (iter.hasNext()) {
			Entry entry = (Entry) iter.next();
			list.add((SDevice) entry.getValue());
		}

		list = deviceSortByIdleTime(list);

		return list.get(0);
	}

	public List<ScheduleEvent> findScheduleEvents(ScheduleScheme scheme,
			Date thisUpdateTime, String type) throws Exception {

		SAXBuilder sb = new SAXBuilder(false);
		StringBuilder strResult = new StringBuilder();
		strResult.append("发生如下事件：\n");
		int n = 0;
		Calendar calendar = Calendar.getInstance();
		calendar.setTime(new Date());
		calendar.add(Calendar.DAY_OF_MONTH, -50);
		Date startDate = calendar.getTime();
		List<ScheduleEvent> scheduleEventList = (List<ScheduleEvent>) scheduleEventDao
				.getUnHandleEvents(scheme.getScheduleUid(), startDate,
						thisUpdateTime, null);// 获得近两天的事件

		if (scheduleEventList != null && scheduleEventList.size() > 0) {
			String str = null;
			for (ScheduleEvent scheduleEvent : scheduleEventList) {
				if (StringUtils.isNotEmpty(scheduleEvent.getEventDesc()))
					continue;
				try {
					str = null;
					String strXml = scheduleEvent.getEventContent();
					StringReader read = new StringReader(strXml);
					Document doc = sb.build(read);
					String eventType = scheduleEvent.getEventType();
					if (eventType
							.equals(ScheduleEvent.EVENTTYPE_PUBLISH_COTASK))
						str = this.eventProPublichCoTask(scheme, scheduleEvent,
								doc);
					else if (eventType
							.equals(ScheduleEvent.EVENTTYPE_UNPUBLISH_COTASK))
						str = this.eventProUnPublichCoTask(scheme,
								scheduleEvent, doc);
					else if (eventType
							.equals(ScheduleEvent.EVENTTYPE_PARTTASK_PLANINFO))
						str = this.eventProPartTaskPlanInfoChange(scheme,
								scheduleEvent, doc);
					else if (eventType
							.equals(ScheduleEvent.EVENTTYPE_LOCK_TASK))
						str = this.eventProLockTask(scheme, scheduleEvent, doc);
					else if (eventType
							.equals(ScheduleEvent.EVENTTYPE_RECEIVE_COTASK))
						str = this.eventProReceiveCoTask(scheme, scheduleEvent,
								doc);
					else if (eventType
							.equals(ScheduleEvent.EVENTTYPE_FEEDBACK_COTASK))
						str = this.eventProFeedbackCoTask(scheme,
								scheduleEvent, doc);
					else if (eventType
							.equals(ScheduleEvent.EVENTTYPE_REFUSE_COTASK))
						str = this.eventProRefuseCoTask(scheme, scheduleEvent,
								doc);
					else if (eventType
							.equals(ScheduleEvent.EVENTTYPE_LATEFINISHCHANGE))
						str = this.eventProLateFinishChange(scheme,
								scheduleEvent, doc);
					else if (eventType
							.equals(ScheduleEvent.EVENTTYPE_SCHEDULECURRENTTIMECHANGE))
						str = this.eventProScheduleCurrentTimeChange(scheme,
								scheduleEvent, doc);
					else if (eventType
							.equals(ScheduleEvent.EVENTTYPE_PREPARETASK_START))
						str = this.eventProStartPrepare(scheme, scheduleEvent,
								doc);
					else if (eventType
							.equals(ScheduleEvent.EVENTTYPE_PREPARETASK_FINISH))
						str = this.eventProCompletePrepare(scheme,
								scheduleEvent, doc);
					else if (eventType
							.equals(ScheduleEvent.EVENTTYPE_PREPARETASK_EXCEPTION))
						str = this.eventProExceptionPrepare(scheme,
								scheduleEvent, doc);
					else if (eventType
							.equals(ScheduleEvent.EVENTTYPE_OPERATIONTASK_PLANINFO))
						str = this.eventProExceptionPrepare(scheme,
								scheduleEvent, doc);
					if (str != null)
						strResult.append(str + "\n");

					n++;
				} catch (RuntimeException e) {

					e.printStackTrace();
				}

				// scheduleEvent.setHandler(MMUtils.getSessionEmployeeId());

				scheduleEvent.setEventDesc(str);
				// scheme.getProcessedEventList().add(scheduleEvent);

			}

			Collections.sort(scheduleEventList, new Comparator<Object>() {
				public int compare(Object o1, Object o2) {
					ScheduleEvent scheduleEvent1 = (ScheduleEvent) o1;
					ScheduleEvent scheduleEvent2 = (ScheduleEvent) o2;
					int i = 0;
					if (scheduleEvent1.getCreateTime().before(
							scheduleEvent2.getCreateTime())) {
						i = 1;
					}
					return i;
				}
			});
		}
		return scheduleEventList;
	}

	// add by zy
	public List<ScheduleEvent> findALlScheduleEvents(ScheduleScheme scheme,
			Date fromDate, Date toDate, Integer eventState, String type,
			Page page) throws Exception {

		SAXBuilder sb = new SAXBuilder(false);
		StringBuilder strResult = new StringBuilder();
		strResult.append("发生如下事件：\n");
		int n = 0;

		List<ScheduleEvent> scheduleEventList = (List<ScheduleEvent>) scheduleEventDao
				.getAllEvents(scheme.getScheduleUid(), fromDate, toDate,
						eventState, type, page);// 获得近两天的事件
		if (scheduleEventList != null && scheduleEventList.size() > 0) {
			String str = null;
			for (ScheduleEvent scheduleEvent : scheduleEventList) {
				if (StringUtils.isNotEmpty(scheduleEvent.getEventDesc()))
					continue;
				try {
					str = null;
					String strXml = scheduleEvent.getEventContent();
					StringReader read = new StringReader(strXml);
					Document doc = sb.build(read);
					String eventType = scheduleEvent.getEventType();
					if (eventType
							.equals(ScheduleEvent.EVENTTYPE_PUBLISH_COTASK))
						str = this.eventProPublichCoTask(scheme, scheduleEvent,
								doc);
					else if (eventType
							.equals(ScheduleEvent.EVENTTYPE_UNPUBLISH_COTASK))
						str = this.eventProUnPublichCoTask(scheme,
								scheduleEvent, doc);
					else if (eventType
							.equals(ScheduleEvent.EVENTTYPE_PARTTASK_PLANINFO))
						str = this.eventProPartTaskPlanInfoChange(scheme,
								scheduleEvent, doc);
					else if (eventType
							.equals(ScheduleEvent.EVENTTYPE_LOCK_TASK))
						str = this.eventProLockTask(scheme, scheduleEvent, doc);
					else if (eventType
							.equals(ScheduleEvent.EVENTTYPE_RECEIVE_COTASK))
						str = this.eventProReceiveCoTask(scheme, scheduleEvent,
								doc);
					else if (eventType
							.equals(ScheduleEvent.EVENTTYPE_FEEDBACK_COTASK))
						str = this.eventProFeedbackCoTask(scheme,
								scheduleEvent, doc);
					else if (eventType
							.equals(ScheduleEvent.EVENTTYPE_REFUSE_COTASK))
						str = this.eventProRefuseCoTask(scheme, scheduleEvent,
								doc);
					else if (eventType
							.equals(ScheduleEvent.EVENTTYPE_LATEFINISHCHANGE))
						str = this.eventProLateFinishChange(scheme,
								scheduleEvent, doc);
					else if (eventType
							.equals(ScheduleEvent.EVENTTYPE_SCHEDULECURRENTTIMECHANGE))
						str = this.eventProScheduleCurrentTimeChange(scheme,
								scheduleEvent, doc);
					else if (eventType
							.equals(ScheduleEvent.EVENTTYPE_PREPARETASK_START))
						str = this.eventProStartPrepare(scheme, scheduleEvent,
								doc);
					else if (eventType
							.equals(ScheduleEvent.EVENTTYPE_PREPARETASK_FINISH))
						str = this.eventProCompletePrepare(scheme,
								scheduleEvent, doc);
					else if (eventType
							.equals(ScheduleEvent.EVENTTYPE_PREPARETASK_EXCEPTION))
						str = this.eventProExceptionPrepare(scheme,
								scheduleEvent, doc);
					else if (eventType
							.equals(ScheduleEvent.EVENTTYPE_PARTTASK_SPLITBATCH))
						str = this.eventProPartTaskSplitBatch(scheme,
								scheduleEvent, doc);
					else if (eventType
							.equals(ScheduleEvent.EVENTTYPE_OPERATIONTASK_PLANINFO))
						str = this.eventProOperationPlanInfo(scheme,
								scheduleEvent, doc);

					else if (eventType
							.equals(ScheduleEvent.EVENTTYPE_PARTTASK_COMBINEBATCH))
						str = this.eventProPartTaskCombineBatch(scheme,
								scheduleEvent, doc);
					else if (eventType
							.equals(ScheduleEvent.EVENTTYPE_PARTTASK_CANCELCOMBINEBATCH))
						str = this.eventProPartTaskCancelCombineBatch(scheme,
								scheduleEvent, doc);
					else if (eventType
							.equals(ScheduleEvent.EVENTTYPE_OPERATIONTASK_GROUP))
						str = this.eventProOperationTaskGroup(scheme,
								scheduleEvent, doc);

					else if (eventType
							.equals(ScheduleEvent.EVENTTYPE_OPERATIONTASK_CANCELGROUP))
						str = this.eventProOperationTaskCancelGroup(scheme,
								scheduleEvent, doc);

					else if (eventType
							.equals(ScheduleEvent.EVENTTYPE_PARTTASK_ADD))
						str = this.eventProPartTaskAdd(scheme, scheduleEvent,
								doc);

					else if (eventType
							.equals(ScheduleEvent.EVENTTYPE_PARTTASK_DELETE))
						str = this.eventProPartTaskDELETE(scheme,
								scheduleEvent, doc);

					else if (eventType
							.equals(ScheduleEvent.EVENTTYPE_OPERATIONTASK_ADD))
						str = this.eventProOperationTaskAdd(scheme,
								scheduleEvent, doc);

					else if (eventType
							.equals(ScheduleEvent.EVENTTYPE_OPERATIONTASK_DELETE))
						str = this.eventProOperationTaskDELETE(scheme,
								scheduleEvent, doc);

					if (str != null)
						strResult.append(str + "\n");

					n++;
				} catch (RuntimeException e) {

					e.printStackTrace();
				}

				// scheduleEvent.setHandler(MMUtils.getSessionEmployeeId());

				scheduleEvent.setEventDesc(str);
				// scheme.getProcessedEventList().add(scheduleEvent);

			}

			Collections.sort(scheduleEventList, new Comparator<Object>() {
				public int compare(Object o1, Object o2) {
					ScheduleEvent scheduleEvent1 = (ScheduleEvent) o1;
					ScheduleEvent scheduleEvent2 = (ScheduleEvent) o2;
					int i = 0;
					if (scheduleEvent1.getCreateTime().before(
							scheduleEvent2.getCreateTime())) {
						i = 1;
					}
					return i;
				}
			});
		}
		return scheduleEventList;
	}

	public String eventProOperationTaskDELETE(ScheduleScheme scheme,
			ScheduleEvent scheduleEvent, Document contentXml) throws Exception {
		try {
			SimpleDateFormat formatDate = new SimpleDateFormat(
					"yyyy-MM-dd HH:mm:ss");
			Element rootElement = contentXml.getRootElement();
			String taskUid = rootElement.getAttributeValue("taskUid");
			String str = "删除工序任务-";
			SOperationTask operationTask = scheme.getAllOperationTaskMap().get(
					taskUid);
			if (operationTask != null) {
				str = operationTask.toFriendlyString();
				if (rootElement.getAttributeValue("earlyStart") != null
						&& !rootElement.getAttributeValue("earlyStart").equals(
								"")) {
					String earlyStart = rootElement
							.getAttributeValue("earlyStart");

					str = str + (operationTask + " 最早开始约束：" + earlyStart);
				}

				if (rootElement.getAttributeValue("lateFinish") != null
						&& !rootElement.getAttributeValue("lateFinish").equals(
								"")) {
					String lateFinish = rootElement
							.getAttributeValue("lateFinish");

					str = str + (" 里程碑节点：" + lateFinish);
				}
			} else {
				String drawingId = rootElement.getAttributeValue("drawingId");
				String batchNum = rootElement.getAttributeValue("batchNum");
				String operationIdDesc = rootElement
						.getAttributeValue("operationIdDesc");
				str = "图号：" + drawingId + "批次：" + batchNum + "工序："
						+ operationIdDesc;
			}
			return str;

		} catch (RuntimeException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}

		return null;

	}

	public String eventProOperationTaskAdd(ScheduleScheme scheme,
			ScheduleEvent scheduleEvent, Document contentXml) throws Exception {
		try {
			SimpleDateFormat formatDate = new SimpleDateFormat(
					"yyyy-MM-dd HH:mm:ss");
			Element rootElement = contentXml.getRootElement();
			String taskUid = rootElement.getAttributeValue("taskUid");
			String str = "新增工序任务-";
			SOperationTask operationTask = scheme.getAllOperationTaskMap().get(
					taskUid);
			if (operationTask != null) {
				str = operationTask.toFriendlyString();
				if (rootElement.getAttributeValue("earlyStart") != null
						&& !rootElement.getAttributeValue("earlyStart").equals(
								"")) {
					String earlyStart = rootElement
							.getAttributeValue("earlyStart");

					str = str + (operationTask + " 最早开始约束：" + earlyStart);
				}

				if (rootElement.getAttributeValue("lateFinish") != null
						&& !rootElement.getAttributeValue("lateFinish").equals(
								"")) {
					String lateFinish = rootElement
							.getAttributeValue("lateFinish");

					str = str + (" 里程碑节点：" + lateFinish);
				}
			} else {
				String drawingId = rootElement.getAttributeValue("drawingId");
				String batchNum = rootElement.getAttributeValue("batchNum");
				String operationIdDesc = rootElement
						.getAttributeValue("operationIdDesc");
				str = "图号：" + drawingId + "批次：" + batchNum + "工序："
						+ operationIdDesc;
			}
			return str;

		} catch (RuntimeException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}

		return null;

	}

	public String eventProPartTaskDELETE(ScheduleScheme scheme,
			ScheduleEvent scheduleEvent, Document contentXml) throws Exception {
		try {
			SimpleDateFormat formatDate = new SimpleDateFormat(
					"yyyy-MM-dd HH:mm:ss");
			Element rootElement = contentXml.getRootElement();
			String taskUid = rootElement.getAttributeValue("taskUid");
			String str = "删除零件任务-";
			SPartTask partTask = scheme.getAllPartTaskMap().get(taskUid);
			if (partTask != null) {
				str = partTask.toFriendlyString();
			} else {
				String drawingId = rootElement.getAttributeValue("drawingId");
				String batchNum = rootElement.getAttributeValue("batchNum");
				String planQty = rootElement.getAttributeValue("planQty");
				str = "图号：" + drawingId + " 批次：" + batchNum;
			}
			return str;

		} catch (RuntimeException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}

		return null;

	}

	public String eventProPartTaskAdd(ScheduleScheme scheme,
			ScheduleEvent scheduleEvent, Document contentXml) throws Exception {
		try {
			SimpleDateFormat formatDate = new SimpleDateFormat(
					"yyyy-MM-dd HH:mm:ss");
			Element rootElement = contentXml.getRootElement();
			String taskUid = rootElement.getAttributeValue("taskUid");
			String str = "新增零件任务-";
			SPartTask partTask = scheme.getAllPartTaskMap().get(taskUid);
			if (partTask != null) {
				str = partTask.toFriendlyString();
			} else {
				String drawingId = rootElement.getAttributeValue("drawingId");
				String batchNum = rootElement.getAttributeValue("batchNum");
				String planQty = rootElement.getAttributeValue("planQty");
				str = "图号：" + drawingId + " 批次：" + batchNum;
			}
			return str;

		} catch (RuntimeException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}

		return null;

	}

	public String eventProOperationTaskCancelGroup(ScheduleScheme scheme,
			ScheduleEvent scheduleEvent, Document contentXml) throws Exception {

		String str = null;
		Element rootElement = contentXml.getRootElement();
		String taskUid = rootElement.getAttributeValue("taskUid");
		SOperationTask operationTask = scheme.getAllOperationTaskMap().get(
				taskUid);
		List<Element> contentList = rootElement.getChildren();
		if (operationTask != null) {
			str = "工序取消合批前的任务" + operationTask.toFriendlyString()
					+ " 取消后产生工序任务: ";
		} else {
			String drawingId = "图号:"
					+ rootElement.getAttributeValue("drawingId");
			String batchNum = "批次:" + rootElement.getAttributeValue("batchNum");
			String operationIdDesc = "工序:"
					+ rootElement.getAttributeValue("operationIdDesc");
			String planQty = "计划数:" + rootElement.getAttributeValue("planQty");
			str = "工序取消合批前的任务" + drawingId + batchNum + operationIdDesc
					+ planQty + " 取消后产生工序任务: ";
		}
		int i = 0;
		// 得到组合批次
		str += "(";
		for (Element element : contentList) {
			i++;
			String drawingId = "图号:" + element.getAttributeValue("drawingId");
			String batchNum = " 批次:" + element.getAttributeValue("batchNum");
			String planQtyString = "计划数:"
					+ element.getAttributeValue("planQty");
			String operationIdDesc = "工序:"
					+ element.getAttributeValue("operationIdDesc");
			str += batchNum + planQtyString + operationIdDesc;
		}
		str += ")";
		return str;
	}

	public String eventProOperationTaskGroup(ScheduleScheme scheme,
			ScheduleEvent scheduleEvent, Document contentXml) throws Exception {

		String str = null;
		Element rootElement = contentXml.getRootElement();
		String taskUid = rootElement.getAttributeValue("taskUid");
		SOperationTask operationTask = scheme.getAllOperationTaskMap().get(
				taskUid);

		List<Element> contentList = rootElement.getChildren();
		if (operationTask != null) {
			str = "工序合批后产生的新任务" + operationTask.toFriendlyString()
					+ " 合批前工序任务: ";
		} else {
			String drawingId = "图号:"
					+ rootElement.getAttributeValue("drawingId");
			String batchNum = "批次:" + rootElement.getAttributeValue("batchNum");
			String operationIdDesc = "工序:"
					+ rootElement.getAttributeValue("operationIdDesc");
			String planQty = "计划数:" + rootElement.getAttributeValue("planQty");
			str = "工序合批后产生的新任务" + drawingId + batchNum + operationIdDesc
					+ planQty + " 合批前工序任务: ";
		}
		int i = 0;
		// 得到组合批次
		str += "(";
		for (Element element : contentList) {
			i++;
			String batchNum = " 批次:" + element.getAttributeValue("batchNum");
			String planQtyString = "计划数:"
					+ element.getAttributeValue("planQty");
			String operationIdDesc = "工序:"
					+ element.getAttributeValue("operationIdDesc");
			str += batchNum + planQtyString + operationIdDesc;
		}
		str += ")";

		return str;
	}

	// ScheduleEvent.EVENTTYPE_LATEFINISHCHANGE
	public String eventProPartTaskPlanInfoChange(ScheduleScheme scheme,
			ScheduleEvent scheduleEvent, Document contentXml) throws Exception {

		SimpleDateFormat formatDate = new SimpleDateFormat(
				"yyyy-MM-dd HH:mm:ss");
		Element rootElement = contentXml.getRootElement();
		String taskUid = rootElement.getAttributeValue("taskUid");
		String drawingId = rootElement.getAttributeValue("drawingId");
		String batchNum = rootElement.getAttributeValue("batchNum");

		String planQty = rootElement.getAttributeValue("planQty");
		String earlyStart = rootElement.getAttributeValue("earlyStart");
		String lateFinish = rootElement.getAttributeValue("lateFinish");
		String isCritical = rootElement.getAttributeValue("isCritical");
		String delayCost = rootElement.getAttributeValue("delayCost");
		String planGrade = rootElement.getAttributeValue("planGrade");

		String newPlanQty = "";
		String newEarlyStart = "";
		String newLateFinish = "";
		String newIsCritical = "";
		String newDelayCost = "";
		String newPlanGrade = "";
		List<Element> elementList = rootElement.getChildren();
		for (Element element : elementList) {
			newPlanQty = element.getAttributeValue("planQty");
			newEarlyStart = element.getAttributeValue("earlyStart");
			newLateFinish = element.getAttributeValue("lateFinish");
			newIsCritical = rootElement.getAttributeValue("isCritical");
			newDelayCost = rootElement.getAttributeValue("delayCost");
			newPlanGrade = rootElement.getAttributeValue("planGrade");

		}

		String str = null;
		SPartTask newPartTask = scheme.getAllPartTaskMap().get(taskUid);
		if (newPartTask != null) {
			str = newPartTask.toFriendlyString();
		} else {
			str = "图号：" + drawingId + "批次：" + batchNum;
		}

		if (!planQty.equals(newPlanQty)) {
			str += " 计划数" + planQty + "→" + newPlanQty + "；";
		}
		if (!isCritical.equals(newIsCritical)) {
			str += " 关键等级" + isCritical + "→" + newIsCritical + "；";
		}
		if (!delayCost.equals(newDelayCost)) {
			str += " 拖期惩罚" + delayCost + "→" + newDelayCost + "；";
		}
		if (!planGrade.equals(newPlanGrade)) {
			str += " 复杂级别" + planGrade + "→" + newPlanGrade + "；";
		}

		if (!earlyStart.equals(newEarlyStart)) {
			if (!newEarlyStart.equals("") && !earlyStart.equals("")) {
				str += " 最早开始" + earlyStart + "→" + newEarlyStart + "；";
			} else if (!newEarlyStart.equals("") && earlyStart.equals("")) {
				str += " 设置最早开始：" + newEarlyStart + "；";
			} else if (newEarlyStart.equals("") && !earlyStart.equals("")) {
				str += " 取消最早开始；";
			}
		}
		if (!lateFinish.equals(newLateFinish)) {
			if (!newLateFinish.equals("") && !lateFinish.equals("")) {
				str += " 交货期" + lateFinish + "→" + newLateFinish + "；";
			} else if (!newLateFinish.equals("") && lateFinish.equals("")) {
				str += " 设置交货期：" + newLateFinish + "；";
			} else if (newLateFinish.equals("") && !lateFinish.equals("")) {
				str += " 取消交货期；";
			}
		}
		return str;

	}

	public String eventProPublichCoTask(ScheduleScheme scheme,
			ScheduleEvent scheduleEvent, Document contentXml) throws Exception {

		try {

			Element rootElement = contentXml.getRootElement();

			return "    新增协作任务:" + "图号:"
					+ rootElement.getAttributeValue("drawingId") + ",批次："
					+ rootElement.getAttributeValue("batchNum") + "工序："
					+ rootElement.getAttributeValue("operationIdDesc");
		} catch (RuntimeException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		return null;
	}

	// ScheduleEvent.EVENTTYPE_UNPUBLISH_COTASK
	public String eventProUnPublichCoTask(ScheduleScheme scheme,
			ScheduleEvent scheduleEvent, Document contentXml) throws Exception {

		try {
			Element rootElement = contentXml.getRootElement();

			String taskUid = rootElement.getAttributeValue("taskUid");
			SCoTask co;
			if (scheme.getCoTaskMap().containsKey(taskUid)) {
				co = (SCoTask) scheme.getCoTaskMap().get(taskUid);
				//		

				return ("    取消协作任务:" + co.toFriendlyString());

			}
		} catch (RuntimeException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		return null;

	}

	// ScheduleEvent.EVENTTYPE_FEEDBACK_COTASK
	public String eventProFeedbackCoTask(ScheduleScheme scheme,
			ScheduleEvent scheduleEvent, Document contentXml) throws Exception {

		try {
			Element rootElement = contentXml.getRootElement();
			String taskUid = rootElement.getAttributeValue("taskUid");
			SOperationTask co = scheme.getAllOperationTaskMap().get(taskUid);
			if (co != null
					&& rootElement.getAttributeValue("planStart") != null
					&& rootElement.getAttributeValue("planFinish") != null) {
				// co.setPlanStart(formatDate.parse(rootElement
				// .getAttributeValue("planStart")));
				// co.setPlanFinish(formatDate.parse(rootElement
				// .getAttributeValue("planFinish")));
				// co.setNotes(rootElement.getAttributeValue("notes"));
				// co.setCoTaskState(SOperationTask.COTASKSTATE_FEEDBACKED);
				// co.setLocked(1); // 协作任务自动设置为锁定
				return ("    委外任务反馈信息:" + co.toFriendlyString());
			}
		} catch (RuntimeException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}

		return null;

	}

	// ScheduleEvent.EVENTTYPE_RECEIVE_COTASK
	public String eventProReceiveCoTask(ScheduleScheme scheme,
			ScheduleEvent scheduleEvent, Document contentXml) throws Exception {
		SimpleDateFormat formatDate = new SimpleDateFormat(
				"yyyy-MM-dd HH:mm:ss");

		try {
			Element rootElement = contentXml.getRootElement();
			String taskUid = rootElement.getAttributeValue("taskUid");

			SOperationTask co = scheme.getAllOperationTaskMap().get(taskUid);
			if (co != null) {
				// co.setNotes(rootElement.getAttributeValue("notes"));
				// co.setCoTaskState(SOperationTask.COTASKSTATE_RECEIVED);
				return ("    委外任务已接收:" + co.toFriendlyString());
			}
		} catch (RuntimeException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}

		return null;

	}

	// ScheduleEvent.EVENTTYPE_REFUSE_COTASK
	public String eventProRefuseCoTask(ScheduleScheme scheme,
			ScheduleEvent scheduleEvent, Document contentXml) throws Exception {

		try {
			Element rootElement = contentXml.getRootElement();
			String taskUid = rootElement.getAttributeValue("taskUid");
			SOperationTask co = scheme.getAllOperationTaskMap().get(taskUid);
			if (co != null) {
				// co.setNotes(rootElement.getAttributeValue("notes"));
				// co.setCoTaskState(SOperationTask.COTASKSTATE_REFUSED);
				return ("    委外任务被拒绝:" + co.toFriendlyString());
			}
		} catch (RuntimeException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		return null;

	}

	// ScheduleEvent.EVENTTYPE_LATEFINISHCHANGE
	public String eventProLateFinishChange(ScheduleScheme scheme,
			ScheduleEvent scheduleEvent, Document contentXml) throws Exception {

		try {
			Element rootElement = contentXml.getRootElement();
			String taskUid = rootElement.getAttributeValue("taskUid");
			SPartTask partTask = scheme.getAllPartTaskMap().get(taskUid);
			if (partTask != null
					&& rootElement.getAttributeValue("newDate") != null
					&& rootElement.getAttributeValue("newDate") != "") {
				String strDate = rootElement.getAttributeValue("newDate");
				// Date dtLateFinish = formatDate.parse(strDate);
				// partTask.setLateFinish(dtLateFinish);
				return (partTask + "交货期变为：" + strDate);
			}
		} catch (RuntimeException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		return null;

	}

	// ScheduleEvent.EVENTTYPE_SCHEDULECURRENTTIMECHANGE
	public String eventProScheduleCurrentTimeChange(ScheduleScheme scheme,
			ScheduleEvent scheduleEvent, Document contentXml) throws Exception {

		Element rootElement = contentXml.getRootElement();
		String strDate = rootElement.getText();
		Date dt;
		try {
			dt = formatDate.parse(strDate);

			return "调度当前时间变为：" + strDate;
		} catch (RuntimeException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		return null;

	}

	public String eventProStartPrepare(ScheduleScheme scheme,
			ScheduleEvent scheduleEvent, Document contentXml) throws Exception {

		try {
			Element rootElement = contentXml.getRootElement();
			String taskUid = rootElement.getAttributeValue("taskUid");

			SOperationTask operationTask = scheme.getAllOperationTaskMap().get(
					taskUid);
			if (operationTask != null) {

				return ("    已开始生产准备:" + operationTask.toFriendlyString());
			}
		} catch (RuntimeException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}

		return null;

	}

	public String eventProCompletePrepare(ScheduleScheme scheme,
			ScheduleEvent scheduleEvent, Document contentXml) throws Exception {
		try {

			Element rootElement = contentXml.getRootElement();
			String taskUid = rootElement.getAttributeValue("taskUid");

			SOperationTask operationTask = scheme.getAllOperationTaskMap().get(
					taskUid);
			if (operationTask != null) {

				return ("    已完成生产准备:" + operationTask.toFriendlyString());
			}
		} catch (RuntimeException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}

		return null;

	}

	public String eventProExceptionPrepare(ScheduleScheme scheme,
			ScheduleEvent scheduleEvent, Document contentXml) throws Exception {
		try {

			Element rootElement = contentXml.getRootElement();
			String taskUid = rootElement.getAttributeValue("taskUid");

			SOperationTask operationTask = scheme.getAllOperationTaskMap().get(
					taskUid);
			if (operationTask != null) {

				// try {
				// Date
				// estimateFinish=formatDate.parse(rootElement.getAttributeValue("estimateFinish"));
				// if(operationTask.getEarlyStart()==null ||
				// estimateFinish.after(operationTask.getEarlyStart()))
				// operationTask.setEarlyStart(estimateFinish);
				//
				// } catch (RuntimeException e) {
				// // TODO Auto-generated catch block
				//				
				// }

				return ("    生产准备异常:" + operationTask.toFriendlyString());
			}
		} catch (RuntimeException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}

		return null;

	}

	public String eventProOperationPlanInfo(ScheduleScheme scheme,
			ScheduleEvent scheduleEvent, Document contentXml) throws Exception {
		try {
			SimpleDateFormat formatDate = new SimpleDateFormat(
					"yyyy-MM-dd HH:mm:ss");
			Element rootElement = contentXml.getRootElement();
			String taskUid = rootElement.getAttributeValue("taskUid");
			String drawingId = rootElement.getAttributeValue("drawingId");
			String batchNum = rootElement.getAttributeValue("batchNum");
			String operationIdDesc = rootElement
					.getAttributeValue("operationIdDesc");

			String locked = rootElement.getAttributeValue("locked");
			String planQty = rootElement.getAttributeValue("planQty");
			String completeQty = rootElement.getAttributeValue("completeQty");
			String estiRunTime = rootElement.getAttributeValue("estiRunTime");
			String estiPreTime = rootElement.getAttributeValue("estiPreTime");
			String earlyStart = rootElement.getAttributeValue("earlyStart");
			String lateFinish = rootElement.getAttributeValue("lateFinish");
			String succOperationStr = rootElement
					.getAttributeValue("succOperationStr");
			String newLocked = "";
			String newPlanQty = "";
			String newCompleteQty = "";
			String newEstiRunTime = "";
			String newEstiPreTime = "";
			String newEarlyStart = "";
			String newLateFinish = "";
			String newSuccOperationStr = "";
			List<Element> elementList = rootElement.getChildren();
			for (Element element : elementList) {
				newLocked = element.getAttributeValue("locked");
				newPlanQty = element.getAttributeValue("planQty");
				newCompleteQty = element.getAttributeValue("completeQty");
				newEstiRunTime = element.getAttributeValue("estiRunTime");
				newEstiPreTime = element.getAttributeValue("estiPreTime");
				newEarlyStart = element.getAttributeValue("earlyStart");
				newLateFinish = element.getAttributeValue("lateFinish");
				newSuccOperationStr = element
						.getAttributeValue("succOperationStr");
			}
			String str = null;
			SOperationTask newOperationTask = scheme.getAllOperationTaskMap()
					.get(taskUid);
			if (newOperationTask != null) {
				str = newOperationTask.toFriendlyString();
			} else {
				str = "图号：" + drawingId + "批次：" + batchNum + "工序："
						+ operationIdDesc;
			}
			if (!locked.equals(newLocked)) {
				if (newLocked.equals("1")) {
					str += " 设置锁定；";
				}
				if (newLocked.equals("0")) {
					str += " 取消锁定；";
				}
			}
			if (!planQty.equals(newPlanQty)) {
				str += " 计划数" + planQty + "→" + newPlanQty + "；";
			}
			if (!completeQty.equals(newCompleteQty)) {
				str += " 完成数" + completeQty + "→" + newCompleteQty + "；";
			}
			if (!estiRunTime.equals(newEstiRunTime)) {
				str += " 单件时间" + estiRunTime + "→" + newEstiRunTime + "；";
			}
			if (!estiPreTime.equals(newEstiPreTime)) {
				str += " 准备时间" + estiPreTime + "→" + newEstiPreTime + "；";
			}
			if (!succOperationStr.equals(newSuccOperationStr)) {
				str += " 后置工序" + succOperationStr + "→" + newSuccOperationStr
						+ "；";
			}
			if (!earlyStart.equals(newEarlyStart)) {
				if (!newEarlyStart.equals("") && !earlyStart.equals("")) {
					str += " 最早开始" + earlyStart + "→" + newEarlyStart + "；";
				} else if (!newEarlyStart.equals("") && earlyStart.equals("")) {
					str += " 设置最早开始：" + newEarlyStart + "；";
				} else if (newEarlyStart.equals("") && !earlyStart.equals("")) {
					str += " 取消最早开始；";
				}
			}
			if (!lateFinish.equals(newLateFinish)) {
				if (!newLateFinish.equals("") && !lateFinish.equals("")) {
					str += " 里程碑节点" + lateFinish + "→" + newLateFinish + "；";
				} else if (!newLateFinish.equals("") && lateFinish.equals("")) {
					str += " 设置里程碑节点：" + newLateFinish + "；";
				} else if (newLateFinish.equals("") && !lateFinish.equals("")) {
					str += " 取消里程碑节点；";
				}
			}
			return str;
		} catch (RuntimeException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		return null;
	}

	public String eventProPartTaskSplitBatch(ScheduleScheme scheme,
			ScheduleEvent scheduleEvent, Document contentXml) throws Exception {
		try {
			SimpleDateFormat formatDate = new SimpleDateFormat(
					"yyyy-MM-dd HH:mm:ss");
			Element rootElement = contentXml.getRootElement();
			List<Element> contentList = rootElement.getChildren();
			String str = null;

			str = rootElement.getAttributeValue("drawingId") + ","
					+ rootElement.getAttributeValue("batchNum") + "分为"
					+ contentList.size() + "个批次。";
			int i = 0;
			for (Element element : contentList) {
				i++;
				str += "批次" + i + "(";
				String batchNum = "批次:" + element.getAttributeValue("batchNum");
				String planQty = " 计划数:" + element.getAttributeValue("planQty");
				String operationId = " 开始工序:"
						+ element.getAttributeValue("operationIdDesc");
				str += batchNum + planQty + operationId + ")";

			}
			return str;

		} catch (RuntimeException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}

		return null;

	}

	public String eventProPartTaskCombineBatch(ScheduleScheme scheme,
			ScheduleEvent scheduleEvent, Document contentXml) throws Exception {
		String str = null;
		Element rootElement = contentXml.getRootElement();
		String taskUid = rootElement.getAttributeValue("taskUid");
		String drawingId = rootElement.getAttributeValue("drawingId");
		String batchNum = rootElement.getAttributeValue("batchNum");
		String planQty = rootElement.getAttributeValue("planQty");
		// 不能通过taskuid来查
		// SPartTask partTask = scheme.getAllPartTaskMap().get(taskUid);
		List<Element> contentList = rootElement.getChildren();
		// if (partTask != null) {
		str = "合批后产生的新零件-" + "图号：" + drawingId + "批次：" + batchNum + "计划数："
				+ planQty + ", 合批前零件任务: ";
		int i = 0;
		// 得到组合批次
		str += "(";
		for (Element element : contentList) {
			i++;
			String batchNum1 = " 批次:" + element.getAttributeValue("batchNum");
			String planQtyString = "计划数:"
					+ element.getAttributeValue("planQty");
			str += batchNum1 + planQtyString;
		}
		str += ")";
		// }
		return str;
	}

	public String eventProPartTaskCancelCombineBatch(ScheduleScheme scheme,
			ScheduleEvent scheduleEvent, Document contentXml) throws Exception {
		String str = null;
		Element rootElement = contentXml.getRootElement();
		String taskUid = rootElement.getAttributeValue("taskUid");
		SPartTask partTask = scheme.getAllPartTaskMap().get(taskUid);
		List<Element> contentList = rootElement.getChildren();
		// 取消合批后原有的零件任务被删除
		if (partTask == null) {
			str = "零件:";

			String batchNum = rootElement.getAttributeValue("batchNum");
			String drawingId = rootElement.getAttributeValue("drawingId");
			String partName = rootElement.getAttributeValue("partName");
			str += partName + " 图号:" + drawingId + " 批次:" + batchNum
					+ "取消合并分解成";
		} else {
			str = partTask.toFriendlyString();
		}

		str += "(";
		int i = 0;
		// 得到组合批次
		for (Element element : contentList) {
			i++;

			String batchNum = " 批次:" + element.getAttributeValue("batchNum");
			String planQty = "计划数:" + element.getAttributeValue("planQty");
			str += batchNum + planQty;
		}
		str += ")";
		return str;
	}

	// 锁定工序任务
	public String eventProLockTask(ScheduleScheme scheme,
			ScheduleEvent scheduleEvent, Document contentXml) throws Exception {

		Element rootElement = contentXml.getRootElement();
		String taskUid = rootElement.getAttributeValue("taskUid");
		SOperationTask co = scheme.getAllOperationTaskMap().get(taskUid);
		if (co != null && rootElement.getAttributeValue("planStart") != null
				&& rootElement.getAttributeValue("planFinish") != null) {
			return ("    工序任务锁定信息:" + co.toFriendlyString());
		}

		return null;

	}

	public ScheduleAnalysis getScheduleAnalysis() {
		return scheduleAnalysis;
	}

	public void setScheduleAnalysis(ScheduleAnalysis scheduleAnalysis) {
		this.scheduleAnalysis = scheduleAnalysis;
	}


	public ScheduleEventDao getScheduleEventDao() {
		return scheduleEventDao;
	}

	public void setScheduleEventDao(ScheduleEventDao scheduleEventDao) {
		this.scheduleEventDao = scheduleEventDao;
	}

	@Override
	public String eventProCompletePrepare(ScheduleScheme scheme, ScheduleEvent scheduleEvent,
			org.dom4j.Document contentXml) throws Exception {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public String eventProExceptionPrepare(ScheduleScheme scheme, ScheduleEvent scheduleEvent,
			org.dom4j.Document contentXml) throws Exception {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public String eventProFeedbackCoTask(ScheduleScheme scheme, ScheduleEvent scheduleEvent,
			org.dom4j.Document contentXml) throws Exception {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public String eventProLateFinishChange(ScheduleScheme scheme, ScheduleEvent scheduleEvent,
			org.dom4j.Document contentXml) throws Exception {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public String eventProLockTask(ScheduleScheme scheme, ScheduleEvent scheduleEvent, org.dom4j.Document contentXml)
			throws Exception {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public String eventProOperationPlanInfo(ScheduleScheme scheme, ScheduleEvent scheduleEvent,
			org.dom4j.Document contentXml) throws Exception {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public String eventProOperationTaskAdd(ScheduleScheme scheme, ScheduleEvent scheduleEvent,
			org.dom4j.Document contentXml) throws Exception {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public String eventProOperationTaskCancelGroup(ScheduleScheme scheme, ScheduleEvent scheduleEvent,
			org.dom4j.Document contentXml) throws Exception {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public String eventProOperationTaskDELETE(ScheduleScheme scheme, ScheduleEvent scheduleEvent,
			org.dom4j.Document contentXml) throws Exception {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public String eventProOperationTaskGroup(ScheduleScheme scheme, ScheduleEvent scheduleEvent,
			org.dom4j.Document contentXml) throws Exception {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public String eventProPartTaskAdd(ScheduleScheme scheme, ScheduleEvent scheduleEvent, org.dom4j.Document contentXml)
			throws Exception {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public String eventProPartTaskCancelCombineBatch(ScheduleScheme scheme, ScheduleEvent scheduleEvent,
			org.dom4j.Document contentXml) throws Exception {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public String eventProPartTaskCombineBatch(ScheduleScheme scheme, ScheduleEvent scheduleEvent,
			org.dom4j.Document contentXml) throws Exception {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public String eventProPartTaskDELETE(ScheduleScheme scheme, ScheduleEvent scheduleEvent,
			org.dom4j.Document contentXml) throws Exception {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public String eventProPartTaskPlanInfoChange(ScheduleScheme scheme, ScheduleEvent scheduleEvent,
			org.dom4j.Document contentXml) throws Exception {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public String eventProPartTaskSplitBatch(ScheduleScheme scheme, ScheduleEvent scheduleEvent,
			org.dom4j.Document contentXml) throws Exception {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public String eventProPublichCoTask(ScheduleScheme scheme, ScheduleEvent scheduleEvent,
			org.dom4j.Document contentXml) throws Exception {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public String eventProReceiveCoTask(ScheduleScheme scheme, ScheduleEvent scheduleEvent,
			org.dom4j.Document contentXml) throws Exception {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public String eventProRefuseCoTask(ScheduleScheme scheme, ScheduleEvent scheduleEvent,
			org.dom4j.Document contentXml) throws Exception {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public String eventProScheduleCurrentTimeChange(ScheduleScheme scheme, ScheduleEvent scheduleEvent,
			org.dom4j.Document contentXml) throws Exception {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public String eventProStartPrepare(ScheduleScheme scheme, ScheduleEvent scheduleEvent,
			org.dom4j.Document contentXml) throws Exception {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public String eventProUnPublichCoTask(ScheduleScheme scheme, ScheduleEvent scheduleEvent,
			org.dom4j.Document contentXml) throws Exception {
		// TODO Auto-generated method stub
		return null;
	}

}
